import { NavBar, Popup } from 'antd-mobile'
import React from 'react'
import style from './index.module.scss'
type TInputPop = {
  children?:React.ReactNode
  visible?:boolean
  close?:()=>void
  title?:string
  submit?:()=>void
}
export default function InputPop ({title,visible,children,close,submit}:TInputPop) {
  return (
    <div>
      <Popup visible={visible} position='right' bodyStyle={{ width: '100vw' }}>
        <NavBar
          style={{
            '--border-bottom': '1px #eee solid'
          }}
          right={<span className={style.submit} onClick={submit}>提交</span>}
          onBack={close}
        >
          {title}
        </NavBar>
        {/* 输入框 */}
        <div className={style.Wrapper}>
          {children}
        </div>
      </Popup>
    </div>
  )
}
